package coba.mailing.query;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;

import coba.mailing.model.Atractivo;

public class FindAllAtractivo {

	public static List<Atractivo> find(Connection con) throws SQLException {

		String sql = " select * from COBA_Recorridos r ";

		PreparedStatement stmt = con.prepareStatement(sql);

		//stmt.setLong(1, itinerarioId);

		ResultSet rs = stmt.executeQuery();

		List<Atractivo> list = new LinkedList<Atractivo>();

		while (rs.next()) {
			Atractivo obj = new Atractivo(
					null,
					rs.getLong("r.id_"),
					rs.getString("r.nombre"),
					rs.getString("r.mails"),
					null);

			list.add(obj);
		}

		rs.close();
		stmt.close();

		return list;

	}

}
